<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    div {
      width: 300px;
      height: 300px;
    }

    .red {
      background-color: red;
    }

    .green {
      /* 1、定位方式-相对定位 */
      position: relative;

      /* 2、偏移值 */
      top: 100px;
      left: 100px;

      background-color: green;
    }

    .blue {
      background-color: blue;
    }

  </style>
</head>
<body>
  <div class="red"></div>
  <div class="green"></div>
  <div class="blue"></div>
</body>
</html>